package com.moji.entity;

import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

//import static com.moji.enums.MoJiEnumConfig.RESERVATION_MEASUREMENT_METHOD_LIJI;
//import static com.moji.enums.MoJiEnumConfig.RESERVATION_MEASUREMENT_METHOD_WEIGHT;

@Data
public class AppointFormReportRespVo {

    /**
     * 仓库类型 1-普通仓  2-监管仓
     */
    @ApiModelProperty(value = "仓库类型 1-普通仓  2-监管仓")
    private Integer warehouseType;

    /**
     * 仓库类型 1-普通仓  2-监管仓
     */
    @ApiModelProperty(value = "仓库类型名称 1-普通仓  2-监管仓")
    private String warehouseTypeName;

    public String getWarehouseTypeName() {
        //普通仓
        if (warehouseType != null && warehouseType == 1){
            return "普通仓";
        }
        //监管仓
        if (warehouseType != null && warehouseType == 2){
            return "监管仓";
        }
        return "-";
    }

    /**
     * 仓库类型数量
     */
    @ApiModelProperty(value = "仓库类型数量")
    private long warehouseTypeCount;


    /**
     * 业务类型  1-入库(普通仓)  2- 入库(监管仓)  3-出库(普通仓)  4-出库(监管仓)
     */
    @ApiModelProperty(value = "业务类型  1-入库(普通仓)  2- 入库(监管仓)  3-出库(普通仓)  4-出库(监管仓)",required = true)
    private Integer bussinessType;

    /**
     * 业务类型名称
     */
    @ApiModelProperty(value = "业务类型名称",required = true)
    private String bussinessTypeName;

    public String getBussinessTypeName() {
        //入库-普通仓
        if (bussinessType != null && bussinessType == 1){
            return "入库(普通仓)";
        }
        //入库-监管仓
        if (bussinessType != null && bussinessType == 2){
            return "入库(监管仓)";
        }

        //出库-普通仓
        if (bussinessType != null && bussinessType == 3){
            return "出库(普通仓)";
        }
        //出库-监管仓
        if (bussinessType != null && bussinessType == 4){
            return "出库(监管仓)";
        }
        return "-";
    }

    /**
     * 业务类型数量
     */
    @ApiModelProperty(value = "业务类型数量")
    private long bussinessTypeCount;

    /**
     * 计量方式  1-理计  2-过磅
     */
    @ApiModelProperty(value = "计量方式  1-理计  2-过磅",required = true)
    private Integer measurementMethod;

    /**
     * 计量方式  1-理计  2-过磅
     */
    @ApiModelProperty(value = "计量方式名称  1-理计  2-过磅",required = true)
    private String measurementMethodName;

    public String getMeasurementMethodName() {
        //理计
        if (measurementMethod != null && measurementMethod == 1){
            return "理计";
        }
        //过磅
        if (measurementMethod != null && measurementMethod == 2){
            return "过磅";
        }
        return "-";
    }

    /**
     * 计量方式数量
     */
    @ApiModelProperty(value = "计量方式数量",required = true)
    private long measurementMethodCount;


    /**
     * 审核状态 0-待审核 1-审核通过 2-审核拒绝 3-审核中
     */
    @ApiModelProperty(value = "审核状态 0-待审核 1-审核通过 2-审核拒绝 3-审核中")
    private Integer status;

    /**
     * 审核状态名称 0-待审核 1-审核通过 2-审核拒绝 3-审核中
     */
    @ApiModelProperty(value = "审核状态名称 0-待审核 1-审核通过 2-审核拒绝 3-审核中")
    private String statusName;


    public String getStatusName() {
        //待审核
        if (status != null && status == 0){
            return "待审核";
        }
        //审核通过
        if (status != null && status == 1){
            return "审核通过";
        }
        //审核拒绝
        if (status != null && status == 2){
            return "审核拒绝";
        }
        //审核中
        if (status != null && status == 3){
            return "审核中";
        }

        return "-";
    }

    /**
     * 审核数量
     */
    @ApiModelProperty(value = "审核数量")
    private long statusCount;

    /**
     * 总数量
     */
    @ApiModelProperty(value = "总数量",required = true)
    private Long totalQuantity;

    /**
     * 理计重量
     */
    @ApiModelProperty(value = "总理计重量",required = true)
    private Double totalAccountingWeight;
    /**
     * 过磅重量
     */
    @ApiModelProperty(value = "总过磅重量")
    private Double totalWeighWeight;

    /**
     * 过磅重量
     */
    @ApiModelProperty(value = "总重量")
    private Double totalWeight;

    public Double getTotalWeight() {
        //理计
//        if (RESERVATION_MEASUREMENT_METHOD_LIJI.getCode().equals(String.valueOf(measurementMethod))){
//            return totalAccountingWeight;
//        }
//        //过磅
//        if (RESERVATION_MEASUREMENT_METHOD_WEIGHT.getCode().equals(String.valueOf(measurementMethod))){
//            return totalWeighWeight;
//        }
        return 0d;
    }
}
